<template>
  <n-drawer v-if="!md" v-model:show="visible" :width="'100%'" placement="left">
    <n-drawer-content closable>
      <FormVue @submit="close" />
    </n-drawer-content>
  </n-drawer>
  <n-modal
    v-else
    v-model:show="visible"
    :show-icon="false"
    preset="dialog"
    :style="{ width: !md ? '100vw' : '600px' }"
    :mask-closable="false"
    @close="close"
  >
    <FormVue @submit="close" />
  </n-modal>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';

  import useH5Breakpoints from '@/hooks/useH5Breakpoints';
  import FormVue from './Form.vue';
  const md = useH5Breakpoints();

  const visible = ref(false);

  function close() {
    visible.value = false;
  }

  defineExpose({
    visible,
  });
</script>
<style lang="less" scoped>
  .el-width {
    width: 360px;
  }
  .title {
    padding: 10px 30px 10px;
    line-height: 24px;
    font-weight: bold;
  }
  .tip {
    padding-left: 100px;
    padding-bottom: 20px;
    font-size: 15px;
    b {
      color: #409eff;
    }
  }
  .need-item {
    width: 200px;
  }
  .number-item {
    width: 200px;
    margin-top: 10px;
  }
  .el-address {
    width: 175px;
  }
</style>
